<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
          <table class="form">
            <tr>
              <td><?php echo $entry_name; ?></td>
              <td><input name="name" value="<?php echo $name; ?>" size="100"/></td>
            </tr>
            <tr>
              <td><?php echo $entry_display_name; ?></td>
              <td><?php foreach ($languages as $language) { ?>
                <input type="text" name="coupon_rule_description[<?php echo $language['language_id']; ?>][display_name]" value="<?php echo isset($coupon_rule_description[$language['language_id']]) ? $coupon_rule_description[$language['language_id']]['display_name'] : ''; ?>" size="100"/>
                <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /><br />
                <?php } ?></td>
            </tr>
            <tr>
              <td><?php echo $entry_discount_type; ?></td>
              <td><input type="radio" name="discount_type" value="0" <?php if($discount_type == 0){echo 'checked="checked"';} ?>/><?php echo $text_discount_type_0; ?>
                <input type="radio" name="discount_type" value="1" <?php if($discount_type == 1){echo 'checked="checked"';} ?>/><?php echo $text_discount_type_1; ?>
                <input type="radio" name="discount_type" value="2" <?php if($discount_type == 2){echo 'checked="checked"';} ?>/><?php echo $text_discount_type_2; ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_discount_points; ?></td>
              <td><input type="text" name="discount_points" value="<?php echo $discount_points; ?>" size="100"/></td>
            </tr>
            <tr>
              <td><?php echo $entry_discount_values; ?></td>
              <td><input type="text" name="discount_values" value="<?php echo $discount_values; ?>" size="100"/></td>
            </tr>
            <tr>
              <td><?php echo $entry_max_use_time; ?></td>
              <td><input type="text" name="max_use_time" value="<?php echo $max_use_time; ?>" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_max_use_day; ?></td>
              <td><input type="text" name="max_use_day" value="<?php echo $max_use_day; ?>" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_category_ids; ?></td>
              <td><input type="text" name="category_ids" value="<?php echo $category_ids; ?>" size="100"/></td>
            </tr>
            <tr>
              <td><?php echo $entry_description; ?></td>
              <td><?php foreach ($languages as $language) { ?>
                <textarea cols="100" rows="6" name="coupon_rule_description[<?php echo $language['language_id']; ?>][description]"><?php echo isset($coupon_rule_description[$language['language_id']]) ? $coupon_rule_description[$language['language_id']]['description'] : ''; ?></textarea>
                <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /><br />
                <?php } ?></td>
            </tr>
          </table>
      </form>
    </div>
  </div>
</div>
<?php echo $footer; ?>